package com.woniuxy.controller;

import com.woniuxy.entity.RbacManager;
import com.woniuxy.service.ManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: ideaAdmin
 * TODO:
 * Date: 2022/1/26:11:19
 * Description:
 */

@RequestMapping("/managerController")
@RestController
public class ManagerController {
    @Autowired
    ManagerService managerService;


    @RequestMapping(value =  "/insert",method = RequestMethod.POST)
    public Boolean insertManager(@RequestBody RbacManager rbacManager){
        return managerService.insertManager(rbacManager);
    }


    @PostMapping("/find/{id}")
    public RbacManager findById(@PathVariable Integer id){
        return managerService.findById(id);
    }


    @PostMapping("/find")
    public RbacManager findById2(@RequestBody String  id){
        return managerService.findById(Integer.parseInt(id));
    }

    @PostMapping("/update")
    public Boolean updateManager(@RequestBody Integer id){
        return managerService.updateManager(id);
    }
    @PostMapping("/del")
    public Boolean delById(@RequestBody Integer id){
        return managerService.delById(id);
    }
}
